<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="js/mui.min.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="css/main.css" />
</head>
<body>
	
	<!--头部-->
		<!--<header class="mui-bar mui-bar-nav">
		    <a class="mui-icon mui-icon-plusempty mui-pull-right" href="#topPopover"></a>
		    <h1 class="mui-title">微信</h1>
		</header>-->
	<!--主体内容-->
	
	<!--脚部-->
	<nav class="mui-bar mui-bar-tab">
	    <a class="mui-tab-item mui-active" href="home.html">
	        <span class="mui-icon mui-icon-chatbubble"></span>
	        <span class="mui-tab-label">微信</span>
	    </a>
	    <a class="mui-tab-item" href="contact.html">
	        <span class="mui-icon mui-icon-contact" ></span>
	        <span class="mui-tab-label">通讯录</span>
	    </a>
	    <a class="mui-tab-item" href="fund.html">
	        <span class="mui-icon mui-icon-navigate"></span>
	        <span class="mui-tab-label">发现</span>
	    </a>
	    <a class="mui-tab-item" href="person.html">
	        <span class="mui-icon mui-icon-person"></span>
	        <span class="mui-tab-label">我</span>
	    </a>
	</nav>
<script type="text/javascript" charset="utf-8">
  	mui.init();
  	//mui加载完成事件
  	mui.plusReady(function(){
  		//定义子页面的数组
  		var pageArr=["home.html","contact.html","fund.html","person.html"];
  		//定义子页面位置样式
  		var subPageStyle={
  			top:"0px",  //距离顶部44
  			bottom:"50px"  //距离底部50
  		}
  		//获取住webView
  		var mainView=plus.webview.currentWebview();
  		//遍历子页面，创建Webview
  		for(var i=0;i<pageArr.length;i++){
  			var url=pageArr[i];
  			var subView=plus.webview.create(url,url,subPageStyle);
  			subView.hide();
  			mainView.append(subView);
  		}
  		//设置默认显示webView
  		plus.webview.show(pageArr[0])
  		
  		//给每个导航栏注册触摸事件,显示子页面
  		mui(".mui-bar-tab").on("tap","a",function(){
  			//获取当前事件源的id
  			var id=this.getAttribute("href");
  			plus.webview.show(id)
  		});
  		
		
		
  	})
</script>
</body>
</html>